import Vue from 'vue'
import Router from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'

Vue.use(Router)

const router =  new Router({
  routes: [
    {
      path:'/',
      redirect:'/login'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/home',
      component: Home,
      redirect:'/welcome',
      children:[
        {
          path:'/welcome',
          component:()=>import('../view/user/Welcome.vue')
        },
        {
          path:'/users',
          component:()=>import('../view/user/Users.vue')
        },
        {
          path:'/reports',
          component:()=>import('../view/report/Report.vue')
        }
      ]
    }
  ]
})

export default router